package com.hckj.medical.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hckj.medical.controller.UsersController;
import com.hckj.medical.entity.Users;
import com.hckj.medical.mapper.UsersMapper;
import com.hckj.medical.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hckj
 * @since 2023-11-25
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements IUsersService {
    @Autowired
    private UsersMapper usersMapper;
    @Override
    public Users selectUsers(String phone) {
        LambdaQueryWrapper<Users> uq = new LambdaQueryWrapper<>();
        uq.eq(Users::getPhone,phone);
        return usersMapper.selectOne(uq);
    }

    @Override
    public Map findBywork(Map map) {
        return usersMapper.selectBywork(map);
    }

    @Override
    public Integer insertUsers(Users users) {
        return usersMapper.insert(users);
    }


}
